package com.ggk911.pharmacy_system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ggk911.pharmacy_system.entity.DrugPrice;
import com.ggk911.pharmacy_system.mapper.DrugPriceMapper;
import com.ggk911.pharmacy_system.service.IDrugPriceService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ggk-911
 * @version 1.0 2023/4/11 17:28
 */
@Service
public class DrugPriceServiceImpl extends ServiceImpl<DrugPriceMapper, DrugPrice> implements IDrugPriceService {
    /**
     * updateByDrugInfoId
     *
     * @param entity
     * @return
     */
    public boolean updateByDrugInfoId(DrugPrice entity) {
        return baseMapper.updateByDrugInfoId(entity.getDrugInfoId(), entity.getDrugPrice());
    }

    /**
     * deleteByDrugInfoId
     *
     * @param id
     * @return
     */
    public boolean deleteByDrugInfoId(Integer id) {
        return baseMapper.deleteByDrugInfoId(id);
    }

    public List<DrugPrice> listAd() {
        return baseMapper.listAd();
    }
}
